﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.Configuration;

namespace SmartWMS.Common.Jwt
{
    public class JwtConfig
    {
        public static JwtInfo JwtInfo { get; private set; }

        public void InitJwtInfo(IConfiguration configuration)
        {
            JwtInfo _jwtInfo = new JwtInfo();
            // _jwtInfo.SecurityKey = configuration["Jwt:JwtSetting:SecurityKey"];
            _jwtInfo.Issuer = configuration["Jwt:JwtSetting:Issuer"];
            _jwtInfo.Audience = configuration["Jwt:JwtSetting:Audience"];
            _jwtInfo.ExpireSeconds = int.Parse(configuration["Jwt:JwtSetting:ExpireSeconds"]);
            JwtInfo = _jwtInfo;
        }
    }

    public class JwtInfo
    {
        public string SecurityKey { get; set; }
        public string Issuer { get; set; }
        public string Audience { get; set; }
        public int ExpireSeconds { get; set; }
    }
}